package com.zzy.app.entity.prop;

import org.springframework.beans.factory.annotation.Value;

import java.util.Arrays;

public class PropPerson {
    @Value("${name}")
    private String name;
    @Value("${age}")
    private int age;
    @Value("${nickname}")
    private String nickname;
    //$用来取配置，#用来spel，先计算$z再算#，顺序不能反
    @Value("#{'${namelist}'.split(',')}")
    private String[] nameList;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    @Override
    public String toString() {
        return "PropPerson{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", nickname='" + nickname + '\'' +
                ", nameList=" + Arrays.toString(nameList) +
                '}';
    }
}
